/**
 * 
 */
package qy.jalgotrade.optimizer.base;

/**
 * @author qy
 *
 */
public class ResultSincFactory {

	/**
	 * 
	 * @param goal
	 * @return
	 */
	public static AbstractResultSinc create(OptimizingGoal goal) {

		switch (goal.getGoalKpi()) {
			case RESULT:
			case RETURN:
			case SHARPE:
			case WIN_RATE:
				return new GreaterResultSinc(goal.getConstraintsCondition(), goal.getRecordAllResults());
			case MAX_DRAWDOWN:
				return new LesserResultSinc(goal.getConstraintsCondition(), goal.getRecordAllResults());
			default:
				throw new IllegalArgumentException("Unsupported OptimizingGoal: " + goal);
		}
	}

	/**
	 * 
	 */
	public ResultSincFactory() {

	}
}
